Skip to content

[messaging] feat: Introduce Messaging Lifecycle Hooks - #41

Merged
Sebastian-Iwanczyszyn merged 16 commits into
mainfrom
feat/introduce-generic-listener
Mar 19, 2026
Merged

[messaging] feat: Introduce Messaging Lifecycle Hooks#41
Sebastian-Iwanczyszyn merged 16 commits into
mainfrom
feat/introduce-generic-listener

Conversation

@Sebastian-Iwanczyszyn

@Sebastian-Iwanczyszyn Sebastian-Iwanczyszyn commented Mar 19, 2026

Copy link
Copy Markdown
Contributor

Motivation

Add Messaging Lifecycle Hooks

This PR introduces lifecycle hooks to the messaging system, allowing developers to plug into different stages of message processing.

Hooks provide a structured way to implement cross-cutting concerns such as:

  • logging
  • tracing
  • validation
  • metrics
  • auditing

docs: https://docs.nestjstools.com/components/lifecycle-hooks


What’s included

New lifecycle hooks:

  • BEFORE_MESSAGE_NORMALIZATION
  • AFTER_MESSAGE_NORMALIZATION
  • AFTER_MESSAGE_DENORMALIZED
  • BEFORE_MESSAGE_HANDLER
  • AFTER_MESSAGE_HANDLER_EXECUTION
  • ON_CONSUMER_HANDLED_MESSAGE
  • ON_FAILED_MESSAGE_CONSUMER

Each hook can be implemented via MessagingLifecycleHookListener.


Type of change

  • Bug fix
  • Feature
  • Refactor
  • Documentation
  • Code improvement / refactoring
  • Other (please describe)

Breaking change

  • Yes
  • No

Checklist

  • Unit tests added/updated
  • E2E tests added/updated (if applicable)
  • Documentation updated if needed

@Sebastian-Iwanczyszyn
Sebastian-Iwanczyszyn merged commit 2d3afc7 into main Mar 19, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant